//第一部分用于动画展示
setTimeout(function() {
	document.querySelectorAll(".show")[0].style.cssText = "transform: translateY(0%);"
	setTimeout(function() {
		document.querySelectorAll(".show")[0].classList.remove("active");
		document.querySelectorAll(".show")[1].classList.add("active");
		certifySwiper = new Swiper('#certify .swiper-container', {
			watchSlidesProgress: true,
			slidesPerView: 'auto',
			centeredSlides: true,
			loop: true,
			loopedSlides: 5,
			autoplay: false,
			navigation: {
				nextEl: '.swiper-button-next',
				prevEl: '.swiper-button-prev',
			},
			pagination: {
				el: '.swiper-pagination',
			},
			on: {
				progress: function(progress) {
					for(i = 0; i < this.slides.length; i++) {
						var slide = this.slides.eq(i);
						var slideProgress = this.slides[i].progress;
						modify = 1;
						if(Math.abs(slideProgress) > 1) {
							modify = (Math.abs(slideProgress) - 1) * 0.3 + 1;
						}
						translate = slideProgress * modify * 260 + 'px';
						scale = 1 - Math.abs(slideProgress) / 5;
						zIndex = 999 - Math.abs(Math.round(10 * slideProgress));
						slide.transform('translateX(' + translate + ') scale(' + scale + ')');
						slide.css('zIndex', zIndex);
						slide.css('opacity', 1);
						if(Math.abs(slideProgress) > 3) {
							slide.css('opacity', 0);
						}
					}
				},
				setTransition: function(transition) {
					for(var i = 0; i < this.slides.length; i++) {
						var slide = this.slides.eq(i)
						slide.transition(transition);
					}
				}
			}

		})
		document.querySelectorAll(".show")[1].style.cssText = "transform: translateY(-85%);"
	}, 2000)
}, 5000);

(function(){
	var left = document.querySelector(".footer_btn").querySelector(".left");
	var right = document.querySelector(".footer_btn").querySelector(".right");
	var center = document.querySelector(".footer_btn").querySelector(".center");
	var check = 0;//保存被选中的状态是 首页为0 我的为1
	//左边按钮状态切换
	mui(".footer_btn").on("tap",".left",function(){
			this.classList.add("active");
			right.classList.remove("active");
			center.classList.remove("active");
			check = 0;
	})
	
	//中间按钮状态切换
	mui(".footer_btn").on("tap",".center",function(){
		this.classList.add("active");
		right.classList.remove("active");
		left.classList.remove("active");
		check = 0;
	})
	
	//右边按钮切换状态
	mui(".footer_btn").on("tap",".right",function(){
			this.classList.add("active");
			left.classList.remove("active");
			center.classList.remove("active");
			check = 0;
	})
	
})()
